package edu.uclmgmu.bacteriosec.domain.gestorFicheros;

import java.io.DataOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class FilesManager {
	
	public static void createFileForCallInTurn(String joinPointName, int callInTurn) throws IOException {
		String fileName=joinPointName + ".numberOfCallInTurn";
		DataOutputStream dos=new DataOutputStream(new FileOutputStream(fileName));
		dos.writeInt(callInTurn);
		dos.close();
		// TODO: borrar
		FileOutputStream auxi=new FileOutputStream(fileName+".txt");
		auxi.write((""+callInTurn).getBytes());
		auxi.close();
	}

	public static void createFileForCurrentCall(String joinPointName, int currentCall) throws IOException {
		String fileName=joinPointName + ".numberOfCurrentCall";
		DataOutputStream dos=new DataOutputStream(new FileOutputStream(fileName));
		dos.writeInt(currentCall);
		dos.close();
		// TODO: borrar
		FileOutputStream auxi=new FileOutputStream(fileName+".txt");
		auxi.write((""+currentCall).getBytes());
		auxi.close();
	}
}
